package br.edu.ifpb.sejabemvindo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends Activity implements OnClickListener {

	EditText nomeEditText; 
	
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        this.nomeEditText = (EditText) findViewById(R.id.nomeEditText);
        Button acessarButton = (Button) findViewById(R.id.acessarButton); 
        acessarButton.setOnClickListener(this);
    }

	@Override
	public void onClick(View v) {
		String nome = nomeEditText.getText().toString();
		
		Intent intent = new Intent(this, MenuListActivity.class);
		intent.putExtra("nome", nome);
		this.startActivity(intent);
		
		//TextView mensagemTextView = (TextView) findViewById(R.id.mensagemTextView);
		//mensagemTextView.setText("Seja bem-vindo, " + nome + ".");
	}
}
